/******************************************************************************
 * * inter_modemadp_interface.h - internal interface between UI and modem adaptor
 *
 * *(C) Copyright 2019 ASR International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
#ifndef INTER_MODEMADP_INTERFACE_H
#define INTER_MODEMADP_INTERFACE_H

#ifdef __cplusplus
extern "C" {
#endif

#include "../modem/mmi_modemadp_interface.h"

/**
 * This message is sent to the calling mobile station
 * to indicate that the call is originating. (after ATD <number>;)
 * param SimId:  MMI_MODEM_SIM_ID
 * param Index:  Connection index
 * return  void
 */
extern VOID Phone_Modem_Call_Response_Originating(MMI_MODEM_SIM_ID SimId, INT32 Index);

/**
 * This message is sent to the calling mobile station
 * to indicate that the called user alerting has been initiated.
 * param SimId:  MMI_MODEM_SIM_ID
 * param Index:  Connection index
 * return  void
 */
extern VOID Phone_Modem_Call_Response_Alerting(MMI_MODEM_SIM_ID SimId, INT32 Index);

/**
 * This message is sent to the called mobile station
 * to indicate an incoming call (voice, data or fax). (RING)
 * param SimId:  MMI_MODEM_SIM_ID
 * param Index:  Connection index
 * return  void
 */
extern VOID Phone_Modem_Call_Response_Ring(MMI_MODEM_SIM_ID SimId, INT32 Index);

/**
 * This message is sent to the calling/called mobile station
 * to indication that the call is connected.
 * param SimId:  MMI_MODEM_SIM_ID
 * param Index:  Connection index
 * return  void
 */
extern VOID Phone_Modem_Call_Response_Connect(MMI_MODEM_SIM_ID SimId, INT32 Index);

/**
 * This message is sent to the calling/called mobile station
 * to indication that the call is disconnected.
 * param SimId:  MMI_MODEM_SIM_ID
 * param Index:  Connection index
 * return  void
 */
extern VOID Phone_Modem_Call_Response_Disconnect(MMI_MODEM_SIM_ID SimId, INT32 Index);

/**
 * Indicates a disconnect for Call Clearing or a Call Failed for an outgoing call. (NO CARRIER)
 * param SimId:  MMI_MODEM_SIM_ID
 * param Index:  Connection index
 * return  void
 */
extern VOID Phone_Modem_Call_Response_No_Carrier(MMI_MODEM_SIM_ID SimId, INT32 Index, UINT8 isNoCarrier);

/**
 * Indicates the calling line identity of the calling party after every RING/+CRING. (+CLIP:)
 * +CLIP: <number>,<type>
 *
 * param SimId:  MMI_MODEM_SIM_ID
 * param Index:  Connection index
 * param Clip:  MMI_MODEM_CALL_RESPONSE_CLIP *
 * return  void
 */
extern VOID Phone_Modem_Call_Response_Clip(MMI_MODEM_SIM_ID SimId, INT32 Index,
                                           MMI_Modem_Call_Response_Clip_t *Clip);

/**
 * Indicats the call state is changed
 *
 * param State:  MMI_MODEM_CALL_RESPONSE_STATE_CHANGE *
 * return  void
 */
extern VOID Phone_Modem_Call_Response_State_Change(MMI_Modem_Call_Response_State_Change_t *State);

/**
 * Update signal bar
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) Bar: MMI_MODEM_SIGNAL_BAR
 * return  VOID
 */
extern VOID Phone_Modem_Signal_Bar_Ind(MMI_MODEM_SIM_ID SimId, MMI_MODEM_SIGNAL_BAR Bar);

/**
 * Update operator name from modem
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) Operator: INT8 *
 * return  VOID
 */
extern VOID Phone_Modem_Operator_Ind(MMI_MODEM_SIM_ID SimId, INT8 *Operator, MMI_MODEM_PLMN_RAT Rat);

/**
 * SIM status changed from modem
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  VOID
 */
extern VOID Phone_Modem_Sim_Status_Ind(MMI_Modem_Sim_Status_t *SimStatus);

/**
 * time auto-update indication
 * param (in) TimeInfo: MMI_Modem_Time_Info_t*
 * return  void
 */
extern VOID Phone_Modem_Time_Update_Ind(MMI_Modem_Time_Info_t *TimeInfo);

/**
 * Indicate When phone book has been loaded by CP
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  VOID
 */
extern VOID Phone_Modem_Phonebook_Init_Ind(MMI_MODEM_SIM_ID SimId);

/**
 * indicate that PIN status changed
 * param (in) simId      :  MMI_MODEM_SIM_ID
 *       (in) PinReqType :  MMI_MODEM_PIN_STATUS_TYPE
 * return  void
 */
extern VOID Phone_Modem_Pin_Status_Change_Ind(MMI_MODEM_SIM_ID SimId, MMI_MODEM_PIN_STATUS_TYPE PinReqType);

/**
 * Indicates Call Waiting (CW) information (when enabled) for an incoming call. (+CCWA:)
 * +CCWA: <number>,<type>,<class>,[<alpha>][,<CLI validity>[,<subaddr>,<satype>[,<priority>]]]
 *
 * param SimId:  MMI_MODEM_SIM_ID
 * param Index:  Connection index
 * param Ccwa:  MMI_MODEM_CALL_RESPONSE_CCWA *
 * return  void
 */
extern VOID Phone_Modem_Call_Response_Ccwa(MMI_MODEM_SIM_ID SimId, INT32 Index,
                                           MMI_Modem_Call_Response_Ccwa_t *Ccwa);

/**
 * query SS service call wait confirm
 * param (in) SimId : MMI_MODEM_SIM_ID
 * param (in) CallWaitOn : BOOL
 * param (in) Resutl : MMI_MODEM_RESULT
 * return void
 */
extern VOID Phone_Modem_Call_Wait_Query_Cnf(MMI_MODEM_SIM_ID SimId, BOOL CallWaitOn, MMI_MODEM_RESULT Result);

/**
 * query SS service call wait confirm
 * param (in) SimId : MMI_MODEM_SIM_ID
 * param (in) CallWaitOn : BOOL
 * param (in) Resutl : MMI_MODEM_RESULT
 * return void
 */
extern VOID Phone_Modem_Call_Wait_Query_Cnf(MMI_MODEM_SIM_ID SimId, BOOL CallWaitOn, MMI_MODEM_RESULT Result);

/**
 * Plmn search cnf
 * param (in) PlmnSearchCnf: MMI_Modem_Plmn_Search_Cnf_t *
 * return void
 */
extern VOID Phone_Modem_Plmn_Search_Cnf(MMI_Modem_Plmn_Search_Cnf_t *PlmnSearchCnf);

/**
 * query SS service call wait confirm
 * param (in) SimId : MMI_MODEM_SIM_ID
 *       (in) Result : MMI_MODEM_RESULT
 * return void
 */
extern VOID Phone_Modem_Call_Forward_Set_Cnf(MMI_MODEM_SIM_ID SimId, MMI_MODEM_RESULT Result);

/**
 * configure SS service call wait confirm
 * param (in) SimId : MMI_MODEM_SIM_ID
 * param (in) CallWaitOn : BOOL (true means call wait on)
 * return void:
 */
extern VOID Phone_Modem_Call_Wait_Set_Cnf(MMI_MODEM_SIM_ID SimId, MMI_MODEM_RESULT Result);

/**
 * Response for getting phone book status
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) PhkStatus: MMI_Modem_Phonebook_Status*
 * return  VOID
 */
extern VOID Phone_Modem_Get_Phonebook_Status_Cnf(MMI_MODEM_SIM_ID           SimId,
                                                 MMI_Modem_Phonebook_Status *PhkStatus);

/**
 * Result for writing phonebook
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) WrittenIndex: UINT16
 * return  VOID
 */
extern VOID Phone_Modem_Write_Phonebook_Cnf(MMI_MODEM_SIM_ID SimId, UINT16 WrittenIndex);

/**
 * Response for reading contacts from phone book
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) Contact: MMI_Modem_Contact*
 * param (in) Number: UINT16
 * param (in) End: BOOL
 * return  VOID
 */
extern VOID Phone_Modem_Read_Phonebook_Cnf(MMI_MODEM_SIM_ID SimId,
                                           MMI_Modem_Contact *Contact,
                                           UINT16 Number,
                                           BOOL End);

/**
 * send new sms cnf
 * param (in) pSendSmsCnf: MMI_Modem_Send_Sms_Cnf_t
 * return  VOID
 */
extern VOID Phone_Modem_Send_Sms_Cnf(MMI_Modem_Send_Sms_Cnf_t *pSendSmsCnf);

/**
 * delete sms cnf
 * param (in) Result:MMI_MODEM_SMS_RESULT_TYPE
 * return  void
 */
extern VOID Phone_Modem_Delete_Sms_Cnf(MMI_MODEM_SMS_RESULT_TYPE Result);

/**
 * set sms centre number cnf
 * param (in) Result:MMI_MODEM_SMS_RESULT_TYPE
 * return  void
 */
extern VOID Phone_Modem_Set_Smsc_Cnf(MMI_MODEM_SMS_RESULT_TYPE Result);

/**
 * set delivery report flg cnf
 * param (in) Result:MMI_MODEM_SMS_RESULT_TYPE
 * return  void
 */
extern VOID Phone_Modem_Set_Delivery_Rep_Cnf(MMI_MODEM_SMS_RESULT_TYPE Result);

/**
 * send Ussd cnf
 * param (in) pSendUssdCnf: MMI_Modem_Send_Ussd_Cnf_t
 * return  void
 */
extern VOID Phone_Modem_Send_Ussd_Cnf(MMI_Modem_Send_Ussd_Cnf_t *pSendUssdCnf);

/**
 * report new sms ind
 * param (in) pRepNewSms:MMI_Modem_Report_New_Sms_Ind_t
 * return  void
 */
extern VOID Phone_Modem_Rep_New_Sms_Ind(MMI_Modem_Report_New_Sms_Ind_t *pRepNewSms);

/**
 * Confirmation for power up modem
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  VOID
 */
extern VOID Phone_Modem_Power_Up_Cnf(MMI_MODEM_SIM_ID SimId);

/**
 * Confirmation for power off modem
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  VOID
 */
extern VOID Phone_Modem_Power_Off_Cnf(MMI_MODEM_SIM_ID SimId);

/**
 * Indicates a result of checking ATD command
 * param isOk:  UINT8
 * return  void
 */
extern VOID Phone_Modem_Call_Response_Dial(UINT8 isOk);

    /**
 * get sms centre number cnf
 * param (in) pGetSmscCnf: MMI_Modem_Get_Smsc_Cnf_t
 * return  void
 */
extern VOID Phone_Modem_Get_Smsc_Cnf_Handler(MMI_Modem_Get_Smsc_Cnf_t *pGetSmscCnf);

/**
 * send new sms cnf
 * param (in) pSendSmsCnf: MMI_Modem_Send_Sms_Cnf_t
 * return  VOID
 */
extern VOID Phone_Modem_Send_Sms_Cnf_Handler(MMI_Modem_Send_Sms_Cnf_t *pSendSmsCnf);

/**
 * read sms detail on sim cnf
 * param (in) pReadSmsCnf: MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t
 * return  void
 */
extern VOID Phone_Modem_Read_Sms_Detail_On_Sim_Cnf_Handler(MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t *pReadSmsCnf);

/**
 * read sms info cnf
 * param (in) pReadSmsInfoCnf: MMI_Modem_Read_Sms_Info_Cnf_t
 * return  void
 */
extern VOID Phone_Modem_Read_Sms_Info_Cnf_Handler(MMI_Modem_Read_Sms_Info_Cnf_t *pReadSmsInfoCnf);

/**
 * get sms centre number cnf
 * param (in) pGetSmscCnf: MMI_Modem_Get_Smsc_Cnf_t
 * return  void
 */
extern VOID Phone_Modem_Get_Smsc_Cnf_Handler(MMI_Modem_Get_Smsc_Cnf_t *pGetSmscCnf);

/**
 * send new sms cnf
 * param (in) pSendSmsCnf: MMI_Modem_Send_Sms_Cnf_t
 * return  VOID
 */
extern VOID Phone_Modem_Send_Sms_Cnf_Handler(MMI_Modem_Send_Sms_Cnf_t *pSendSmsCnf);

/**
 * read sms detail on sim cnf
 * param (in) pReadSmsCnf: MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t
 * return  void
 */
extern VOID Phone_Modem_Read_Sms_Detail_On_Sim_Cnf_Handler(MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t *pReadSmsCnf);

/**
 * read sms info cnf
 * param (in) pReadSmsInfoCnf: MMI_Modem_Read_Sms_Info_Cnf_t
 * return  void
 */
extern VOID Phone_Modem_Read_Sms_Info_Cnf_Handler(MMI_Modem_Read_Sms_Info_Cnf_t *pReadSmsInfoCnf);

/**
 * send new sms cnf
 * param (in) pSendSmsCnf: MMI_Modem_Send_Sms_Cnf_t
 * return  void
 */
extern void Phone_Modem_Send_Sms_Cnf(MMI_Modem_Send_Sms_Cnf_t * pSendSmsCnf);

#ifdef __cplusplus
}
#endif

#endif /*INTER_MODEMADP_INTERFACE_H*/
